package com.wxl.common.wiget

import android.content.Context
import android.util.AttributeSet
import android.view.MotionEvent
import android.view.View
import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer
import com.wxl.common.util.Loog

/**
 * create file time : 2021/4/21
 * create user : wxl
 * subscribe :
 */
class StandardNotEventVideoPlayer : StandardGSYVideoPlayer {



    constructor(context: Context?, fullFlag: Boolean?) : super(context, fullFlag)
    constructor(context: Context?) : super(context)
    constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)

    override fun startPlayLogic() {
        prepareVideo()
    }

    override fun showWifiDialog() {

    }

    override fun showProgressDialog(
        deltaX: Float,
        seekTime: String?,
        seekTimePosition: Int,
        totalTime: String?,
        totalTimeDuration: Int
    ) {
    }

    override fun onTouch(v: View?, event: MotionEvent?): Boolean {
        return false
    }


    override fun showVolumeDialog(deltaY: Float, volumePercent: Int) {

    }


    override fun showBrightnessDialog(percent: Float) {

    }

    override fun onClickUiToggle() {

    }

    override fun hideAllWidget() {
        setViewShowState(mBottomContainer, View.INVISIBLE)
        setViewShowState(mTopContainer, View.INVISIBLE)
        setViewShowState(mBottomProgressBar, View.INVISIBLE)
        setViewShowState(mStartButton, View.INVISIBLE)
    }

    override fun changeUiToNormal() {
        setViewShowState(mBottomContainer, View.INVISIBLE)
        setViewShowState(mTopContainer, View.INVISIBLE)
        setViewShowState(mBottomProgressBar, View.INVISIBLE)
        setViewShowState(mStartButton, View.INVISIBLE)
    }

    override fun changeUiToPreparingShow() {
        setViewShowState(mTopContainer, View.VISIBLE)
        setViewShowState(mBottomContainer, View.INVISIBLE)
        setViewShowState(mStartButton, View.INVISIBLE)
        setViewShowState(mLoadingProgressBar, View.INVISIBLE)
        setViewShowState(mThumbImageViewLayout, View.INVISIBLE)
        setViewShowState(mBottomProgressBar, View.INVISIBLE)
        setViewShowState(mLockScreen, View.GONE)
    }


    override fun changeUiToPlayingShow() {
        setViewShowState(mTopContainer, View.INVISIBLE)
        setViewShowState(mBottomContainer, View.INVISIBLE)
        setViewShowState(mStartButton, View.INVISIBLE)
        setViewShowState(mLoadingProgressBar, View.INVISIBLE)
        setViewShowState(mThumbImageViewLayout, View.INVISIBLE)
        setViewShowState(mBottomProgressBar, View.INVISIBLE)
        setViewShowState(mLockScreen, View.GONE)
    }

    override fun changeUiToCompleteShow() {
        setViewShowState(mBottomContainer, View.INVISIBLE)
        setViewShowState(mTopContainer, View.INVISIBLE)
        setViewShowState(mBottomProgressBar, View.INVISIBLE)
        setViewShowState(mStartButton, View.INVISIBLE)
    }


    override fun changeUiToCompleteClear() {
        setViewShowState(mTopContainer, View.INVISIBLE)
        setViewShowState(mBottomContainer, View.INVISIBLE)
        setViewShowState(mStartButton, View.INVISIBLE)
        setViewShowState(mLoadingProgressBar, View.INVISIBLE)
        setViewShowState(mThumbImageViewLayout, View.VISIBLE)
        setViewShowState(mBottomProgressBar, View.VISIBLE)
        setViewShowState(mLockScreen, View.GONE)
    }


    override fun changeUiToPauseShow() {
        setViewShowState(mTopContainer, View.INVISIBLE)
        setViewShowState(mBottomContainer, View.INVISIBLE)
        setViewShowState(mStartButton, View.INVISIBLE)
        setViewShowState(mLoadingProgressBar, View.INVISIBLE)
        setViewShowState(mThumbImageViewLayout, View.INVISIBLE)
        setViewShowState(mBottomProgressBar, View.INVISIBLE)
        setViewShowState(mLockScreen, View.GONE)
    }




}